import http from "@/utils/http";

/**
 * 查询列表
 */
export const getDictList = () => {
  return http.get("/crm/system/getSassDictListSys");
};

/**
 * 新增/编辑
 */
export const updateDict = (data: any) => {
  return http.post("/crm/system/insertOrUpdateDictData", data);
};

/**
 * 查系统字典
 */
export const getSysDict = (dictType: string) => {
  return http.get(`/dbo/system/dict/data/dictType/${dictType}`);
};

/**
 * 查非系统字典
 */
export const getDict = (dictType: string) => {
  return http.get("/crm/system/getDictDataList", { dictType });
};
/**
 * 删除
 */
export const delDict = (dictCode: string) => {
  return http.deleteMethod(`/crm/system/deleteByDictDataCode?dictCode=${dictCode}`);
};
/**
 * 查询支付方式列表
 */
export const getPaymentList = () => {
  return http.post("/finance/dict/list",{dictType:'pay_type'});
};

/**
 * 新增
 */
export const addPayment = (data: any) => {
  return http.post("/finance/dict/add", data);
};
/**
 * 编辑
 */
export const editPayment = (data: any) => {
  return http.post("/finance/dict/update", data);
};